package org.flown.util.mq;

import org.apache.activemq.ActiveMQConnectionFactory;

import javax.jms.*;


/**
 * <bean id="ActiveMQUtil" class="org.flown.util.mq.ActiveMQUtil">
 *     <property name="TopicConnectionFactory" ref="ActiveMQConnectionFactory"></property>
 * <bean/>
 *
 * <bean id="ActiveMQUtil" class="org.flown.util.mq.ActiveMQUtil">
 *     <property name="broker_url" value="tcp://127.0.0.1:61616"/>
 *     <property name="username" value="admin"/>
 *     <property name="password" value="admin"/>
 * <bean/>
 *
 * @author weifei(flown)
 * */
public class ActiveMQUtil extends MQUtil
{

    public ActiveMQUtil(String broker_url)
    {
        super(new ActiveMQConnectionFactory(broker_url));
    }
    public ActiveMQUtil(String broker_url, String username, String password)
    {
        super(new ActiveMQConnectionFactory(username, password, broker_url));
    }


    public void setTopicConnectionFactory(String broker_url, String username, String password)
            throws JMSException
    {
        this.setTopicConnectionFactory(new ActiveMQConnectionFactory(username, password, broker_url));
    }


    public static void init(String broker_url) {new ActiveMQUtil(broker_url);}
    public static void init(String broker_url, String username, String password) {new ActiveMQUtil(username, password, broker_url);}


}




















